<?php

namespace app\api\validate;

use think\Validate;

/**
 * 问题清单
 */
class PatrolTaskValidate  extends  Validate
{
    protected $rule = [
        'id' => 'require|dbExists:patrol_task,id',
        'user_shop_id' => 'require|dbExists:user_shop,id',
        'content' => 'require',
        'images' => 'require',
        'cases_type_id' => 'require|dbExists:cases_type,id',
        'detachment_id' => 'require|dbExists:user_staff,id',
    ];

    protected $message = [
        'id.require' => '未找到信息',
        'id.dbExists' => '未找到信息',
        'user_shop_id.require' => '请选择商户',
        'user_shop_id.dbExists' => '商户不存在',
        'content.require' => '请输入上报原因',
        'images.require' => '请上传图片',
        'cases_type_id.require' => '请选择事件类型',
        'cases_type_id.dbExists' => '事件类型不存在',
        'detachment_id.require' => '请选择支队长',
        'detachment_id.dbExists' => '未找到用户',


    ];

    protected $scene = [
        'add' => ['user_shop_id','content','images','cases_type_id'],
        'appear' => ['id','detachment_id'],
    ];

}
